﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
      <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/Jqbox.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.loadmask.css" rel="stylesheet" type="text/css" />
    <script src="../Js/jquery-1.5.2.min.js" type="text/javascript"></script>
    <script src="../Js/ligerui.min.js" type="text/javascript"></script>
    <script src="../Js/jquery.dialog.js" type="text/javascript"></script>
    <script src="../Js/jquery.loadmask.min.js" type="text/javascript"></script>
    <script src="../Js/json2.js" type="text/javascript"></script>
    <script src="../Js/conmon.js" type="text/javascript"></script>
    <script type="text/javascript">

        var pWind = null;
        // 重置密码
        var $UpdateItem = new Object();
        $(function () {
            pWind = parent.window.parent.window.getWindow();

            // 数据初始化
            $.getJSON('../WebServer/MainAdmin.ashx?Action=GetSystem', null, function (data) {
                if (data != null) {
                    $("#phone").val(data.phone);
                    $("#smtp_host").val(data.smtp_host);
                    $("#smtp_port").val(data.smtp_port);
                    $("#smtp_password").val(data.smtp_password);
                    $("#send_email").val(data.send_email);
                    $("#localhost").val(data.localhost);
                    $("#adid").val(data.adminid);
                    $("#issend").attr("checked", data.issend);
                    $("#adname").val(data.adminname);
                }
            });

            //  保存
            $("#btnSave").click(function () {
                var pars = {
                    "phone": $("#phone").val(),
                    "smtp_host": $("#smtp_host").val(),
                    "smtp_port": $("#smtp_port").val(),
                    "smtp_password": $("#smtp_password").val(),
                    "send_email": $("#send_email").val(),
                    "localhost": $("#localhost").val(),
                    "adminid": $("#adid").val(),
                    "issend": $("#issend").attr("checked")
                };

                $.post('../WebServer/MainAdmin.ashx?Action=SetSystem', pars, function (data) {
                    var rdata = eval("(" + data + ")");
                    if (rdata.IsSuccess == 1) {
                        showAlertOk("修改成功");
                        parent.window.closeDialog(false, "");
                    } else {
                        showErrorTip(rdata.Msg);
                        parent.window.closeDialog(false, "");
                    }
                });
            });


            // 关闭
            $("#btnCancel").click(function () {
                parent.window.closeDialog(false, "");
            });


            $("#setpassword").click(function () {
                $UpdateItem.id = $("#adid").val();
                $UpdateItem.name = $("#adname").val();
                ShowDialogEx("sysManage/UpdatePwd2.htm", "修改密码", 270, 210);
            });

        });

    </script>

     <style type="text/css">
        .edittable td.editcellmessage,.edittable td.editcellverify,.edittable td.editcell{ padding:5px;line-height:25px;}
        .edittable td.editcellmessage{ padding-left:20px;} 
        body { font-size:12px; background:white;}
         
    </style>
</head>
<body>
<table cellpadding="0" border="0" cellspacing="0" class="edittable">
    <tr>
        <td class="editcellmessage"> <label>管理员手机</label> </td>
        <td><input id="phone" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><label>SMTP 服务器地址</label></td>
        <td><input id="smtp_host" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><label>SMTP 服务器端口</label></td>
        <td><input id="smtp_port" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><label>SMTP 服务器密码</label></td>
        <td><input id="smtp_password" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><label>通知发送邮件</label></td>
        <td><input id="send_email" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><label>系统平台地址</label></td>
        <td><input id="localhost" type="text" /></td>
    </tr>
    <tr>
        <td class="editcellmessage"><input id="issend" type="checkbox" /><label>创建考场发送通知</label></td>
        <td><a id="setpassword" class="button" href="javascript:void(0);"><span>修改密码</span></a></td>
    </tr>
</table>
<input id="adid" type="hidden" />
<input id="adname" type="hidden" />

       <div class="buttonpanel">
             <div style="float:right;margin-right:10px;">
                 <a id="btnSave" class="button" href="javascript:void(0);"><span>保存</span></a>
                 <a id="btnCancel" class="button" href="javascript:void(0);"><span>关闭</span></a>
              </div>
      </div>
</body>
</html>
